package jmine.tec.services.utils.replace.transformation;

import jmine.tec.services.utils.replace.api.ServiceRow;

/**
 * @author lundberg
 */
public class ReplaceAllContentTransformation extends AbstractReplaceContentTransformation {

    private final String replacement;

    public ReplaceAllContentTransformation(String action, String name, String parameter, String replacement) {
        super(action, name, parameter);
        this.replacement = replacement;
    }

    @Override
    protected String getNewContent(ServiceRow row) {
        return this.replacement;
    }

    @Override
    public String toString() {
        return String.format("replaceContent Column '%s' -> '%s'", this.parameter, this.replacement);
    }

    @Override
    protected boolean acceptServiceRow(ServiceRow row) {
        return true;
    }
}
